package com.yun.algorithmproblem.leetcode;

import java.util.Arrays;

public class Leetcode2274 {

    public static void main(String[] args) {

    }

    public int maxConsecutive(int bottom, int top, int[] special) {
        Arrays.sort(special);
        int ans=Math.max(special[0]-bottom,top-special[special.length-1]);
        for (int i = 0; i < special.length-1; i++) {
            ans=Math.max(ans,special[i+1]-special[i]-1);
        }
        return ans;
    }
}
